package com.polaris.live.adapter

import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.polaris.live.common.adapter.BaseBindingAdapter
import com.polaris.live.common.adapter.VBViewHolder
import com.polaris.live.common.ext.dp
import com.polaris.live.databinding.AdapterUserProfilePhotosBinding
import com.polaris.live.resp.back_resp.UserOtherPhotoVo
import com.polaris.live.utils.image.ImageUtils
import com.polaris.live.utils.image.normal

/**
 * UserProfilePhotoAdapter
 *
 * @author Created by 半仙 on 2023/9/28/028 11:43
 */
class UserProfilePhotoAdapter :
    BaseBindingAdapter<AdapterUserProfilePhotosBinding, UserOtherPhotoVo>() {

    override fun convert(
        holder: VBViewHolder<AdapterUserProfilePhotosBinding>,
        item: UserOtherPhotoVo
    ) {
        holder.vb.apply {
            Glide.with(userPhoto.context).load(ImageUtils.imgPathMiddle(item.url))
                .normal()
                .transform(RoundedCorners(4.dp)).into(userPhoto)
        }
    }

}